package com.fooddelivery.Common.responseVO;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 订单详情响应对象
 * 包含订单基本信息和订单菜品列表
 */
@Data
@ApiModel(value = "OrderDetailVO", description = "订单详情响应对象")
public class OrderDetailVO {

    @ApiModelProperty("订单ID")
    private Long id;

    @ApiModelProperty("订单编号")
    private String orderNumber;

    @ApiModelProperty("买家姓名")
    private String buyer;

    @ApiModelProperty("订单总金额")
    private BigDecimal totalAmount;

    @ApiModelProperty("收货地址")
    private String address;

    @ApiModelProperty("备注")
    private String notes;

    @ApiModelProperty("手机号")
    private String phone;

    @ApiModelProperty("支付状态(0未支付,1已支付)")
    private Byte payState;

    @ApiModelProperty("订单状态(0新单,1取消,2完成)")
    private Byte orderState;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("修改时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("订单菜品列表")
    private List<OrderDishItemVO> dishItems;

    /**
     * 订单菜品项响应对象
     */
    @Data
    @ApiModel(value = "OrderDishItemVO", description = "订单菜品项响应对象")
    public static class OrderDishItemVO {

        @ApiModelProperty("菜品ID")
        private Long dishId;

        @ApiModelProperty("菜品名称")
        private String dishName;

        @ApiModelProperty("菜品价格")
        private BigDecimal price;

        @ApiModelProperty("菜品图片URL")
        private String image;

        @ApiModelProperty("菜品描述")
        private String description;

        @ApiModelProperty("购买数量")
        private Integer quantity;

        @ApiModelProperty("小计金额(数量*单价)")
        private BigDecimal subtotal;
    }
}
